import service from '@/api/service'
import type { Page } from '@/type/User'
import type { PageQuery } from '@/type/common/list-types'
import type { PermDto, PermVo } from '@/type/system/perm-types'

const mapping = 'perm'


/** 条件分页查询权限列表 */
export const permListApi = (pageQuery: PageQuery) =>
  service.post<Page<PermVo[]>>(`${mapping}/page`, pageQuery)

/** 根据权限编号获取菜单信息 */
export const permInfoApi = (permId: string) => service.get<PermVo>(`${mapping}/${permId}`)

/** 保存权限信息 */
export const savePermApi = (perm: PermDto) => service.put(`${mapping}`, perm)
